-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/cli offset #2591
Fix/cli offset #2591
Conversation
includes/classes/IndexHelper.php
Outdated
/* translators: 1. Number of objects indexed */ | ||
esc_html__( 'Skipping %1$d %2$s posts...', 'elasticpress' ), | ||
$from, | ||
esc_html( strtolower( $indexable->labels['plural'] ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oscarssanchez a few things in this block:
- The "translators" comment should be aligned with the esc_html__ call (an example here)
- It is missing the second placeholder description
- If I'm reading this right, the
%2$s
will become "posts", "users", etc., right? If so, won't it becomeSkipping 100 posts posts...
(duplicated posts)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @felipeelia thanks i've fixed here a95e35d and here cf7cf41
includes/classes/IndexHelper.php
Outdated
@@ -648,10 +648,34 @@ function( $item ) { | |||
} | |||
} | |||
|
|||
$from = $this->index_meta['offset'] - count( $this->current_query['objects'] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of placing this entire code inside of index_next_batch()
, wouldn't it be better to add it to index_objects()
, right before we actually start indexing things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @felipeelia I've moved this code here: 993fe3b
Description of the Change
This PR changes the current message that's being displayed when a WP CLI index is triggered with a specified offset. Introduces
index_meta['skip_message_shown']
to check whether we have shown theSkipping X...
message.Closes #2557
Alternate Designs
Possible Drawbacks
Verification Process
Checklist:
Changelog Entry
Credits
Props @